bug fixes for xcsv reader. (#295)
For some lines data must be accumulated from several fields
in arbitrary field order.
Previously this was done with global variables. Now a variable to
hold the accumulated data for a line is constructed/destructed for
each line.
This eliminates the possiblity of unintended communication between
lines.
This also eliminated some unintended communication between the reader
and the writer through global variables that they previously shared
(csv_track, csv_route).
An ordering sensitivty to TRACK_NEW and TRACK_NAME is removed.
For the reader, conditional allocation of route_heads is removed
from xcsv_parse_val, and centralized in xcsv_data_read.
This eliminates some undetected
memory leaks which hid as "still reachable" due to the pointer
being saved in a global variable (csv_track, csv_route).
Undesirable reading of the route_head->Q variable is
eliminated improving encapsulation. I beleive the intent was
never to decide if the csv_track->Q was empty, i.e. it hadn't been
added to the global track_head yet. I beleive what was desired was
to decide if csv_track had any waypoints. In any event the
centralization of route_head allocation and head addition makes new
track handling much more straight forward and robust.
The xcsv test case is enhanced to increase coverage.